// pages/video/video.js
import request from "../../utils/request";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    navList: [],//导航标签
    navId: '', //导航的标识
    videoList: [],//视频列表数据
    vid: '', //视频ID
    videourl:'', //视频路径
    // videoUpdateTime:[],//记录video播放的时长
    isTriggered:false,//标识下拉刷新是否被触发
    videoTime:0,//记录video播放的时长
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getNavList()
  },
  //跳转搜索页面
  toSearchPage() {
    wx.navigateTo({
        url: '/pages/search/search'
    })
},
  // 获取导航列表
async getNavList() {
    let navData = await request("/video/group/list");
    this.setData({
      navList : navData.data.slice(0, 10),
      navId:navData.data[0].id
    })
  this.getvideoList(this.data.navId)
},
//获取主体信息来源
async getvideoList(navId,num){
 let videoListData = await request('/video/group',{id:navId})
 console.log(videoListData);
 //关闭消息提示框
 wx.hideLoading();
 let index = 0;
 let videoList = videoListData.datas.map(item =>{
   item.id = index++;
   return item;
 })
 this.setData({
  videoList,
  isTriggered:false
 })
 //关闭下拉刷新的窗口
 wx.startPullDownRefresh()
},
// 视频播放
async getvideos(vid){
  let getvideourl = await request('/video/url',{id:vid})
  let videourl = getvideourl.urls.map(item =>{
    return item.url
  })
  this.setData({
    videourl
  })
  // this.videoContext = wx.createVideoContext(vid)
  // //播放回到之前位置
  // let {videoUpdateTime} = this.data;
  // console.log(videoUpdateTime);
  // let videoItem = videoUpdateTime.find(item => item.vid === vid);
  // console.log(videoItem);
  // if(videoItem) {
  // this.videoContext.seek(videoItem.currentTime)
  // }else{
  //   console.log(11);
  // }
  // this.videoContext.play();
},
//点击切换导航的问题
changeNav(event) {
 let navId = event.currentTarget.id;
//  let navId = event.currentTarget.dataset.id;
 this.setData({
  //  navId
   navId:navId>>>0,
   videoList:[]
 })
 //显示正在加载
 wx.showLoading({
   title:'正在加载'
 })
 this.getvideoList(this.data.navId)
},
//点击播放继续回调
playVideo(event){
  let vid = event.currentTarget.id;
  // this.vid !== vid && this.videoContext && this.videoContext.stop();
  // this.vid = vid;
  this.setData({
    vid
  })
  this.getvideos(vid)
},
//监听视频进度的问题
handtimeupdate(event){
  let videoTime = event.detail.currentTime;
  // let videoTimeObj = {vid: event.currentTarget.id,currentTime:event.detail.currentTime};
  // let {videoUpdateTime} = this.data;
//   let videoItem = videoUpdateTime.find(item => item.vid === videoTimeObj.vid);
//   if(videoItem) {//之前
//     videoItem.currentTime = videoTimeObj.currentTime
//   }else{//之后
//   videoUpdateTime.push(videoTimeObj);
// }
  this.setData({
    // videoUpdateTime,
    videoTime
  })
},
//视频结束调用
handleEnded(event){
  console.log('播放结束');
  let {videoUpdateTime} = this.data;
  videoUpdateTime.splice(videoUpdateTime.findIndex(item => 
  item.vid === event.currentTarget.id),1);
  this.setData ({
  videoUpdateTime    
  })
},
//头部刷新
handlerRefresh(){
    //1.重置数组
      this.setData({
      videoList:[]
  })
  this.getvideoList(this.data.navId)
},
//底部刷新
handlerScrollLower(){
   let newVideoList = [
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_493BC4E64C18685CADB822769CBF4458",
              "coverUrl": "https://p2.music.126.net/bQOdt-3IbUreccpOTsXZdg==/109951163573407694.jpg",
              "height": 720,
              "width": 1280,
              "title": "盘点那些烂大街的EDM歌曲",
              "description": "有一些无论你在大街小巷都能听得到的歌曲，大家打趣地将其称之为烂大街或者神曲。其实这并不是一种贬义，而是对这些火过头的歌曲无法用其他更适合的词汇来形容。就如同人们总说苹果手机烂大街，却都承认其是全球最好的手机一样",
              "commentCount": 333,
              "shareCount": 137,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 20784442
                  },
                  {
                      "resolution": 480,
                      "size": 33264770
                  },
                  {
                      "resolution": 720,
                      "size": 42706461
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 1000000,
                  "authStatus": 1,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/4nLfjfG2suiF-hLltblImw==/109951165982909695.jpg",
                  "accountStatus": 0,
                  "gender": 1,
                  "city": 1003100,
                  "birthday": 912268800000,
                  "userId": 45144541,
                  "userType": 10,
                  "nickname": "悦电音",
                  "signature": "悦电音不仅有电音，更有料等你来撩。合作请私信",
                  "description": "音乐博主",
                  "detailDescription": "音乐博主",
                  "avatarImgId": 109951165982909700,
                  "backgroundImgId": 109951165982959550,
                  "backgroundUrl": "http://p1.music.126.net/wwNi5dxPxKgTI1AYIWswww==/109951165982959545.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": null,
                  "djStatus": 10,
                  "vipType": 11,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951165982959545",
                  "avatarImgIdStr": "109951165982909695"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  },
                  {
                      "id": 13164,
                      "name": "快乐",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_1535762492_zjJktWCO.webp?wsSecret=253ecb290b7589c793efacefab635cb2&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "493BC4E64C18685CADB822769CBF4458",
              "durationms": 267772,
              "playTime": 181214,
              "praisedCount": 1256,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_0AAD60AB6925FEDB1E6EDA732B7FDEDA",
              "coverUrl": "https://p1.music.126.net/PRkEc9mpwZ0RmdN7hpzRTg==/109951163726939311.jpg",
              "height": 1080,
              "width": 1920,
              "title": "Ummet Ozcan x PollyAnna - Starchild【官方MV】",
              "description": "Ummet Ozcan x PollyAnna - Starchild【官方MV】",
              "commentCount": 27,
              "shareCount": 8,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 11806550
                  },
                  {
                      "resolution": 480,
                      "size": 19778899
                  },
                  {
                      "resolution": 720,
                      "size": 29184956
                  },
                  {
                      "resolution": 1080,
                      "size": 50398277
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 320000,
                  "authStatus": 0,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/fzQHvzcuOyJX41PCfN8OCQ==/109951164426031658.jpg",
                  "accountStatus": 0,
                  "gender": 1,
                  "city": 320500,
                  "birthday": -2209017600000,
                  "userId": 134733911,
                  "userType": 0,
                  "nickname": "cycmx",
                  "signature": "",
                  "description": "",
                  "detailDescription": "",
                  "avatarImgId": 109951164426031660,
                  "backgroundImgId": 109951164125634980,
                  "backgroundUrl": "http://p1.music.126.net/64s4Y0IcTocyWkvFpI1N_Q==/109951164125634970.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": {
                      "1": "音乐视频达人"
                  },
                  "djStatus": 0,
                  "vipType": 11,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951164125634970",
                  "avatarImgIdStr": "109951164426031658"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 58100,
                      "name": "现场",
                      "alg": null
                  },
                  {
                      "id": 1000,
                      "name": "MV",
                      "alg": null
                  },
                  {
                      "id": 57106,
                      "name": "欧美现场",
                      "alg": null
                  },
                  {
                      "id": 1100,
                      "name": "音乐现场",
                      "alg": null
                  },
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2189811187_hJ2m4jFF.webp?wsSecret=048a30b60ab74fdcb7aa65e7b9924da3&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "Starchild",
                      "id": 1332718562,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 711465,
                              "name": "Ummet Ozcan",
                              "tns": [],
                              "alias": []
                          },
                          {
                              "id": 136461,
                              "name": "Pollyanna",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 100,
                      "st": 0,
                      "rt": "",
                      "fee": 1,
                      "v": 7,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 74845717,
                          "name": "Starchild",
                          "picUrl": "http://p4.music.126.net/py7KzGlBR3UfT_5gsHvlAw==/109951163720365676.jpg",
                          "tns": [],
                          "pic_str": "109951163720365676",
                          "pic": 109951163720365680
                      },
                      "dt": 156813,
                      "h": {
                          "br": 320000,
                          "fid": 0,
                          "size": 6273611,
                          "vd": -3
                      },
                      "m": {
                          "br": 192000,
                          "fid": 0,
                          "size": 3764184,
                          "vd": -3
                      },
                      "l": {
                          "br": 128000,
                          "fid": 0,
                          "size": 2509471,
                          "vd": -2
                      },
                      "a": null,
                      "cd": "01",
                      "no": 1,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 1,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 1419024,
                      "mv": 10785489,
                      "publishTime": 1544716800007,
                      "privilege": {
                          "id": 1332718562,
                          "fee": 1,
                          "payed": 0,
                          "st": 0,
                          "pl": 0,
                          "dl": 0,
                          "sp": 0,
                          "cp": 0,
                          "subp": 0,
                          "cs": false,
                          "maxbr": 320000,
                          "fl": 0,
                          "toast": false,
                          "flag": 4,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "0AAD60AB6925FEDB1E6EDA732B7FDEDA",
              "durationms": 162308,
              "playTime": 39573,
              "praisedCount": 185,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_058976DC7ECD6196B33BFB6657648AC2",
              "coverUrl": "https://p2.music.126.net/bwkZqRci_COmSRUkF0Wixg==/109951164119846442.jpg",
              "height": 720,
              "width": 1280,
              "title": "谁规定儿歌是孩子的专属?Jauz带你玩儿歌“Baby Shark”",
              "description": null,
              "commentCount": 71,
              "shareCount": 338,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 50222722
                  },
                  {
                      "resolution": 480,
                      "size": 81454282
                  },
                  {
                      "resolution": 720,
                      "size": 79769591
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 1000000,
                  "authStatus": 1,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/4nLfjfG2suiF-hLltblImw==/109951165982909695.jpg",
                  "accountStatus": 0,
                  "gender": 1,
                  "city": 1003100,
                  "birthday": 912268800000,
                  "userId": 45144541,
                  "userType": 10,
                  "nickname": "悦电音",
                  "signature": "悦电音不仅有电音，更有料等你来撩。合作请私信",
                  "description": "音乐博主",
                  "detailDescription": "音乐博主",
                  "avatarImgId": 109951165982909700,
                  "backgroundImgId": 109951165982959550,
                  "backgroundUrl": "http://p1.music.126.net/wwNi5dxPxKgTI1AYIWswww==/109951165982959545.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": null,
                  "djStatus": 10,
                  "vipType": 11,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951165982959545",
                  "avatarImgIdStr": "109951165982909695"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 3107,
                      "name": "混剪",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 23111,
                      "name": "歌曲remix",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  }
              ],
              "previewUrl": null,
              "previewDurationms": 0,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "Baby Shark",
                      "id": 1350263842,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 30140937,
                              "name": "Pinkfong",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 100,
                      "st": 0,
                      "rt": "",
                      "fee": 0,
                      "v": 5,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 75778045,
                          "name": "Pinkfong Animal Songs",
                          "picUrl": "http://p3.music.126.net/v6951DjAc47JcqX3vjT_DQ==/109951163906970062.jpg",
                          "tns": [],
                          "pic_str": "109951163906970062",
                          "pic": 109951163906970060
                      },
                      "dt": 96391,
                      "h": {
                          "br": 221000,
                          "fid": 0,
                          "size": 2699747,
                          "vd": -3
                      },
                      "m": {
                          "br": 192000,
                          "fid": 0,
                          "size": 2314075,
                          "vd": -3
                      },
                      "l": {
                          "br": 128000,
                          "fid": 0,
                          "size": 1542731,
                          "vd": -3
                      },
                      "a": null,
                      "cd": "01",
                      "no": 1,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 0,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 0,
                      "mv": 10857297,
                      "publishTime": 0,
                      "privilege": {
                          "id": 1350263842,
                          "fee": 0,
                          "payed": 0,
                          "st": 0,
                          "pl": 192000,
                          "dl": 192000,
                          "sp": 7,
                          "cp": 1,
                          "subp": 1,
                          "cs": false,
                          "maxbr": 192000,
                          "fl": 192000,
                          "toast": false,
                          "flag": 128,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "058976DC7ECD6196B33BFB6657648AC2",
              "durationms": 234522,
              "playTime": 620762,
              "praisedCount": 4531,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_8D8370D57F5B672D91447B87F190B7DE",
              "coverUrl": "https://p1.music.126.net/eFwbPrj6pZVBJO75eXvJ5g==/109951163574298701.jpg",
              "height": 720,
              "width": 1280,
              "title": "Pirupa - Save A Prayer (Original Mix) [Rebellion]",
              "description": "Pirupa - Save A Prayer (Original Mix) [Rebellion] [Progressive Astronaut]",
              "commentCount": 0,
              "shareCount": 0,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 10322271
                  },
                  {
                      "resolution": 480,
                      "size": 12943365
                  },
                  {
                      "resolution": 720,
                      "size": 15687265
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 440000,
                  "authStatus": 0,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/TFT6gOsSk6fp-nGzM-VTqg==/109951164843899858.jpg",
                  "accountStatus": 0,
                  "gender": 1,
                  "city": 440600,
                  "birthday": 840470400000,
                  "userId": 52883345,
                  "userType": 207,
                  "nickname": "n0isa",
                  "signature": "~",
                  "description": "",
                  "detailDescription": "",
                  "avatarImgId": 109951164843899860,
                  "backgroundImgId": 109951166577430380,
                  "backgroundUrl": "http://p1.music.126.net/VcIt3Yt3Ss1pNIKB59U6yw==/109951166577430390.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": null,
                  "djStatus": 10,
                  "vipType": 11,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951166577430390",
                  "avatarImgIdStr": "109951164843899858"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 1105,
                      "name": "最佳饭制",
                      "alg": null
                  },
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 15241,
                      "name": "饭制",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_1955840439_UAd98mAN.webp?wsSecret=25959fbcc1fc1323fb38539974769e31&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "Save A Prayer (Original Mix)",
                      "id": 34057147,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 192455,
                              "name": "Pirupa",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 5,
                      "st": 0,
                      "rt": null,
                      "fee": 0,
                      "v": 4,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 3270796,
                          "name": "CRISTALLO",
                          "picUrl": "http://p4.music.126.net/eZ9xz0NlzMNwVmeArjbIlQ==/7788940372317640.jpg",
                          "tns": [],
                          "pic": 7788940372317640
                      },
                      "dt": 444316,
                      "h": null,
                      "m": null,
                      "l": {
                          "br": 96000,
                          "fid": 0,
                          "size": 5332471,
                          "vd": 3992
                      },
                      "a": null,
                      "cd": "1",
                      "no": 3,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 0,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 0,
                      "mv": 0,
                      "publishTime": 1438876800007,
                      "privilege": {
                          "id": 34057147,
                          "fee": 0,
                          "payed": 0,
                          "st": 0,
                          "pl": 96000,
                          "dl": 96000,
                          "sp": 7,
                          "cp": 1,
                          "subp": 1,
                          "cs": false,
                          "maxbr": 96000,
                          "fl": 96000,
                          "toast": false,
                          "flag": 128,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "8D8370D57F5B672D91447B87F190B7DE",
              "durationms": 444220,
              "playTime": 292,
              "praisedCount": 1,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_7DC3EE9E745A1737D73B54B68A8CAAC8",
              "coverUrl": "https://p2.music.126.net/ra0H9c6WlPW9vj4MuKDQqg==/109951165246180895.jpg",
              "height": 720,
              "width": 1280,
              "title": "WYR GEMI - Black Samurai",
              "description": "WYR GEMI - Black Samurai ",
              "commentCount": 18,
              "shareCount": 39,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 13614635
                  },
                  {
                      "resolution": 480,
                      "size": 23384646
                  },
                  {
                      "resolution": 720,
                      "size": 32216752
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 650000,
                  "authStatus": 0,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/udFX6woEkj2wcuTgI8dECA==/109951166632772510.jpg",
                  "accountStatus": 0,
                  "gender": 1,
                  "city": 652800,
                  "birthday": 857796701439,
                  "userId": 1876394858,
                  "userType": 204,
                  "nickname": "R丨DFZzz",
                  "signature": "",
                  "description": "",
                  "detailDescription": "",
                  "avatarImgId": 109951166632772510,
                  "backgroundImgId": 109951166468365820,
                  "backgroundUrl": "http://p1.music.126.net/1-uu6tKxhZwQMJNSyJgQLQ==/109951166468365832.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": null,
                  "djStatus": 10,
                  "vipType": 0,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951166468365832",
                  "avatarImgIdStr": "109951166632772510"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 1105,
                      "name": "最佳饭制",
                      "alg": null
                  },
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 15241,
                      "name": "饭制",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_3091923257_qypefjXt.webp?wsSecret=0d4208364ba75627cfa2d3aa2b329f51&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "Black Samurai",
                      "id": 1402818475,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 33698765,
                              "name": "WYR GEMI",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 100,
                      "st": 0,
                      "rt": "",
                      "fee": 8,
                      "v": 8,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 83216729,
                          "name": "Black Samurai",
                          "picUrl": "http://p3.music.126.net/YmzkTymtdnnbxXDucqDvDw==/109951164481690423.jpg",
                          "tns": [],
                          "pic_str": "109951164481690423",
                          "pic": 109951164481690420
                      },
                      "dt": 198687,
                      "h": {
                          "br": 320000,
                          "fid": 0,
                          "size": 7949627,
                          "vd": -33203
                      },
                      "m": {
                          "br": 192000,
                          "fid": 0,
                          "size": 4769794,
                          "vd": -30604
                      },
                      "l": {
                          "br": 128000,
                          "fid": 0,
                          "size": 3179877,
                          "vd": -28888
                      },
                      "a": null,
                      "cd": "01",
                      "no": 1,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 1,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 743010,
                      "mv": 0,
                      "publishTime": 1573142400000,
                      "privilege": {
                          "id": 1402818475,
                          "fee": 8,
                          "payed": 0,
                          "st": 0,
                          "pl": 128000,
                          "dl": 0,
                          "sp": 7,
                          "cp": 1,
                          "subp": 1,
                          "cs": false,
                          "maxbr": 320000,
                          "fl": 128000,
                          "toast": false,
                          "flag": 5,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "7DC3EE9E745A1737D73B54B68A8CAAC8",
              "durationms": 195569,
              "playTime": 53098,
              "praisedCount": 338,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_6BFBBEE340AA602737F2A4AE67BB1FCC",
              "coverUrl": "https://p2.music.126.net/KjYmTYJ67xsQBuSS-0hgAg==/109951163573850195.jpg",
              "height": 720,
              "width": 1280,
              "title": "孔雀眼《你的烟熏到我没有关系》",
              "description": "孔雀眼《你的烟熏到我没有关系》，来自台湾的电子迷幻乐队，由吉他手伊璇、鼓手雨欣、曾是草东没有派对前身草东街派对成员的主唱令晴组成，从Acid House到Trip Hop，她们的音乐一直有着迷离又鲜明的体验，以电子乐为基底，杂糅不同音乐元素，在反复吟唱的歌词中构建她们的音乐奇想空间……#摇滚热现场#",
              "commentCount": 20,
              "shareCount": 44,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 19641638
                  },
                  {
                      "resolution": 480,
                      "size": 33207294
                  },
                  {
                      "resolution": 720,
                      "size": 54109007
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 350000,
                  "authStatus": 0,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/tb8-dIH6MEI7fsXkinEOwA==/109951164417862349.jpg",
                  "accountStatus": 0,
                  "gender": 1,
                  "city": 350200,
                  "birthday": 1567267200000,
                  "userId": 253843819,
                  "userType": 204,
                  "nickname": "嬉皮星球",
                  "signature": "独立音乐推广人",
                  "description": "",
                  "detailDescription": "",
                  "avatarImgId": 109951164417862350,
                  "backgroundImgId": 109951164417865380,
                  "backgroundUrl": "http://p1.music.126.net/W7Bkj5fyBoYAS5fzRLJQuA==/109951164417865376.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": {
                      "1": "音乐视频达人"
                  },
                  "djStatus": 0,
                  "vipType": 11,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951164417865376",
                  "avatarImgIdStr": "109951164417862349"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 58100,
                      "name": "现场",
                      "alg": null
                  },
                  {
                      "id": 59101,
                      "name": "华语现场",
                      "alg": null
                  },
                  {
                      "id": 57108,
                      "name": "流行现场",
                      "alg": null
                  },
                  {
                      "id": 59108,
                      "name": "巡演现场",
                      "alg": null
                  },
                  {
                      "id": 1100,
                      "name": "音乐现场",
                      "alg": null
                  },
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14216,
                      "name": "贝斯",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_1720272189_l7cDOI4h.webp?wsSecret=30f9468e09994854f3e263a4e79059db&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "你的烟熏到我没关系",
                      "id": 420401203,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 12079035,
                              "name": "孔雀眼",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 70,
                      "st": 0,
                      "rt": "",
                      "fee": 8,
                      "v": 34,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 34779110,
                          "name": "孔雀眼同名迷你專輯",
                          "picUrl": "http://p3.music.126.net/p7AL1ObDZk8Yn_qtyvXPJQ==/109951164427780831.jpg",
                          "tns": [],
                          "pic_str": "109951164427780831",
                          "pic": 109951164427780830
                      },
                      "dt": 252386,
                      "h": {
                          "br": 320000,
                          "fid": 0,
                          "size": 10098285,
                          "vd": -31357
                      },
                      "m": {
                          "br": 192000,
                          "fid": 0,
                          "size": 6058989,
                          "vd": -28783
                      },
                      "l": {
                          "br": 128000,
                          "fid": 0,
                          "size": 4039341,
                          "vd": -26868
                      },
                      "a": null,
                      "cd": "1",
                      "no": 6,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 2,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 653015,
                      "mv": 0,
                      "publishTime": 1439395200000,
                      "privilege": {
                          "id": 420401203,
                          "fee": 8,
                          "payed": 0,
                          "st": 0,
                          "pl": 128000,
                          "dl": 0,
                          "sp": 7,
                          "cp": 1,
                          "subp": 1,
                          "cs": false,
                          "maxbr": 999000,
                          "fl": 128000,
                          "toast": false,
                          "flag": 0,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "6BFBBEE340AA602737F2A4AE67BB1FCC",
              "durationms": 242300,
              "playTime": 15900,
              "praisedCount": 130,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_D33F54329C923671F2CD2B613A4FBEFC",
              "coverUrl": "https://p1.music.126.net/Czgk0AG_JRxoR5WB24nviQ==/109951165005049092.jpg",
              "height": 1080,
              "width": 1920,
              "title": "三首超嗨电音歌曲，听了有开兰博基尼的感觉！太上头了",
              "description": "三首超嗨电音歌曲，听了有开兰博基尼的感觉！太上头了",
              "commentCount": 11,
              "shareCount": 6,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 30099759
                  },
                  {
                      "resolution": 480,
                      "size": 50041379
                  },
                  {
                      "resolution": 720,
                      "size": 71831674
                  },
                  {
                      "resolution": 1080,
                      "size": 130825105
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 330000,
                  "authStatus": 0,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/mAaGRS_CQM7E5HX2z5od8w==/109951163081302585.jpg",
                  "accountStatus": 0,
                  "gender": 0,
                  "city": 330100,
                  "birthday": -2209017600000,
                  "userId": 1309046981,
                  "userType": 204,
                  "nickname": "蘑菇头音乐",
                  "signature": "用音乐讲故事！分享原创音乐视频",
                  "description": "",
                  "detailDescription": "",
                  "avatarImgId": 109951163081302600,
                  "backgroundImgId": 109951163200937180,
                  "backgroundUrl": "http://p1.music.126.net/NGBDSGHr4Y2Uv1Fp9X9k-Q==/109951163200937186.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": {
                      "1": "音乐原创视频达人",
                      "2": "华语音乐资讯达人"
                  },
                  "djStatus": 10,
                  "vipType": 0,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951163200937186",
                  "avatarImgIdStr": "109951163081302585"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_3007224332_CS6mH0a9.webp?wsSecret=07395572a09bc392f83b7f700f9dcf2b&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "Nevada",
                      "id": 418602088,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 747030,
                              "name": "Vicetone",
                              "tns": [],
                              "alias": []
                          },
                          {
                              "id": 1097153,
                              "name": "Cozi Zuehlsdorff",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 100,
                      "st": 0,
                      "rt": null,
                      "fee": 8,
                      "v": 127,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 34750015,
                          "name": "Nevada",
                          "picUrl": "http://p3.music.126.net/X_Ukd1BhXdDwsz4NqrisNA==/109951163640412456.jpg",
                          "tns": [],
                          "pic_str": "109951163640412456",
                          "pic": 109951163640412450
                      },
                      "dt": 208561,
                      "h": {
                          "br": 320000,
                          "fid": 0,
                          "size": 8344599,
                          "vd": -41700
                      },
                      "m": {
                          "br": 192000,
                          "fid": 0,
                          "size": 5006777,
                          "vd": -39300
                      },
                      "l": {
                          "br": 128000,
                          "fid": 0,
                          "size": 3337866,
                          "vd": -38100
                      },
                      "a": null,
                      "cd": "01",
                      "no": 1,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 0,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 729016,
                      "mv": 5343058,
                      "publishTime": 1466726400000,
                      "privilege": {
                          "id": 418602088,
                          "fee": 8,
                          "payed": 0,
                          "st": 0,
                          "pl": 128000,
                          "dl": 0,
                          "sp": 7,
                          "cp": 1,
                          "subp": 1,
                          "cs": false,
                          "maxbr": 999000,
                          "fl": 128000,
                          "toast": false,
                          "flag": 4,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "D33F54329C923671F2CD2B613A4FBEFC",
              "durationms": 243050,
              "playTime": 24125,
              "praisedCount": 112,
              "praised": false,
              "subscribed": false
          }
      },
      {
          "type": 1,
          "displayed": false,
          "alg": "onlineHotGroup",
          "extAlg": null,
          "data": {
              "alg": "onlineHotGroup",
              "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
              "threadId": "R_VI_62_369009C0D10939F38796E630D574450A",
              "coverUrl": "https://p2.music.126.net/A3zINkkbW-KlXVn5qRavHg==/109951164975629771.jpg",
              "height": 1080,
              "width": 1920,
              "title": "Astronomia 2K19|哭着来到这个世界，当然要笑着离开",
              "description": "生离死别，\n人生常态，\n何必那么悲伤呢？\n哭着来到这个世界，\n当然要笑着离开。\n#超燃计划#",
              "commentCount": 21,
              "shareCount": 47,
              "resolutions": [
                  {
                      "resolution": 240,
                      "size": 12628544
                  },
                  {
                      "resolution": 480,
                      "size": 20452872
                  },
                  {
                      "resolution": 720,
                      "size": 29348293
                  },
                  {
                      "resolution": 1080,
                      "size": 53577633
                  }
              ],
              "creator": {
                  "defaultAvatar": false,
                  "province": 0,
                  "authStatus": 0,
                  "followed": false,
                  "avatarUrl": "http://p1.music.126.net/SUeqMM8HOIpHv9Nhl9qt9w==/109951165647004069.jpg",
                  "accountStatus": 30,
                  "gender": 0,
                  "city": 100,
                  "birthday": -2209017600000,
                  "userId": 3279605222,
                  "userType": 204,
                  "nickname": "帐号已注销",
                  "signature": "",
                  "description": "",
                  "detailDescription": "",
                  "avatarImgId": 109951165647004060,
                  "backgroundImgId": 109951162868128400,
                  "backgroundUrl": "http://p1.music.126.net/2zSNIqTcpHL2jIvU6hG0EA==/109951162868128395.jpg",
                  "authority": 0,
                  "mutual": false,
                  "expertTags": null,
                  "experts": {
                      "1": "影视视频达人"
                  },
                  "djStatus": 0,
                  "vipType": 0,
                  "remarkName": null,
                  "backgroundImgIdStr": "109951162868128395",
                  "avatarImgIdStr": "109951165647004069"
              },
              "urlInfo": null,
              "videoGroup": [
                  {
                      "id": 1105,
                      "name": "最佳饭制",
                      "alg": null
                  },
                  {
                      "id": 9104,
                      "name": "电子",
                      "alg": null
                  },
                  {
                      "id": 4104,
                      "name": "电音",
                      "alg": null
                  },
                  {
                      "id": 5100,
                      "name": "音乐",
                      "alg": null
                  },
                  {
                      "id": 3102,
                      "name": "二次元",
                      "alg": null
                  },
                  {
                      "id": 14212,
                      "name": "欧美音乐",
                      "alg": null
                  },
                  {
                      "id": 72116,
                      "name": "短片",
                      "alg": null
                  },
                  {
                      "id": 15241,
                      "name": "饭制",
                      "alg": null
                  },
                  {
                      "id": 23116,
                      "name": "音乐推荐",
                      "alg": null
                  }
              ],
              "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2994543176_sBk7cs8i.webp?wsSecret=f79b585fa6b27f950c8e791fe89fbb57&wsTime=1637550357",
              "previewDurationms": 4000,
              "hasRelatedGameAd": false,
              "markTypes": null,
              "relateSong": [
                  {
                      "name": "Astronomia 2K19 (Radio Edit)",
                      "id": 1389068435,
                      "pst": 0,
                      "t": 0,
                      "ar": [
                          {
                              "id": 807043,
                              "name": "Stephan F",
                              "tns": [],
                              "alias": []
                          }
                      ],
                      "alia": [],
                      "pop": 100,
                      "st": 0,
                      "rt": "",
                      "fee": 8,
                      "v": 7,
                      "crbt": null,
                      "cf": "",
                      "al": {
                          "id": 81407875,
                          "name": "Party Time Compilation 2019",
                          "picUrl": "http://p3.music.126.net/xyDPKxIc4iAbk6dJvFjDYA==/109951164346924741.jpg",
                          "tns": [],
                          "pic_str": "109951164346924741",
                          "pic": 109951164346924740
                      },
                      "dt": 190486,
                      "h": {
                          "br": 320000,
                          "fid": 0,
                          "size": 7622574,
                          "vd": -65167
                      },
                      "m": {
                          "br": 192000,
                          "fid": 0,
                          "size": 4573562,
                          "vd": -62684
                      },
                      "l": {
                          "br": 128000,
                          "fid": 0,
                          "size": 3049056,
                          "vd": -61388
                      },
                      "a": null,
                      "cd": "01",
                      "no": 3,
                      "rtUrl": null,
                      "ftype": 0,
                      "rtUrls": [],
                      "djId": 0,
                      "copyright": 1,
                      "s_id": 0,
                      "rtype": 0,
                      "rurl": null,
                      "mst": 9,
                      "cp": 1416075,
                      "mv": 0,
                      "publishTime": 1568304000000,
                      "privilege": {
                          "id": 1389068435,
                          "fee": 8,
                          "payed": 0,
                          "st": 0,
                          "pl": 128000,
                          "dl": 0,
                          "sp": 7,
                          "cp": 1,
                          "subp": 1,
                          "cs": false,
                          "maxbr": 999000,
                          "fl": 128000,
                          "toast": false,
                          "flag": 260,
                          "preSell": false
                      }
                  }
              ],
              "relatedInfo": null,
              "videoUserLiveInfo": null,
              "vid": "369009C0D10939F38796E630D574450A",
              "durationms": 191765,
              "playTime": 204243,
              "praisedCount": 490,
              "praised": false,
              "subscribed": false
          }
      }
  ]
//   let videoList = this.data.videoList;
//     videoList.push(...newVideoList);
    this.setData({
    videoList:[...this.data.videoList,...newVideoList]
})
},
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function ({from}) {
    console.log(from);
    if(from ==='button') {
      return {
        title:'来自button转发',
        page:'/pages/video/video',
        imageUrl:'/static/img/2.jpg'
      }
    }else{
      return{
        title:'来自menu转发',
        page:'/pages/video/video',
        imageUrl:'/static/img/2.jpg'
      }
    }
  }
})